/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:49 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class PhuonganEntity
    {
        public PhuonganEntity()
        {
			m_pk_iphuonganid=0;
			m_snoidung="";
			m_bdung=false;
			m_dngaytao=DateTime.Now;
			m_dngaycapnhat=DateTime.Now;
			m_fk_inguoitao=0;
			m_fk_inguoicapnhat=0;
			m_fk_idanhmuccauhoiid=0;
        }
		private Int64 m_pk_iphuonganid;
		public Int64 PK_iPhuonganID
		{
			get { return m_pk_iphuonganid ; }
			set { m_pk_iphuonganid = value; }
		}
		private String m_snoidung;
		public String sNoidung
		{
			get { return m_snoidung ; }
			set { m_snoidung = value; }
		}
		private Boolean m_bdung;
		public Boolean bDung
		{
			get { return m_bdung ; }
			set { m_bdung = value; }
		}
		private DateTime m_dngaytao;
		public DateTime dNgaytao
		{
			get { return m_dngaytao ; }
			set { m_dngaytao = value; }
		}
		private DateTime m_dngaycapnhat;
		public DateTime dNgaycapnhat
		{
			get { return m_dngaycapnhat ; }
			set { m_dngaycapnhat = value; }
		}
		private Int64 m_fk_inguoitao;
		public Int64 FK_iNguoitao
		{
			get { return m_fk_inguoitao ; }
			set { m_fk_inguoitao = value; }
		}
		private Int64 m_fk_inguoicapnhat;
		public Int64 FK_iNguoicapnhat
		{
			get { return m_fk_inguoicapnhat ; }
			set { m_fk_inguoicapnhat = value; }
		}
		private Int16 m_fk_idanhmuccauhoiid;
		public Int16 FK_iDanhmuccauhoiID
		{
			get { return m_fk_idanhmuccauhoiid ; }
			set { m_fk_idanhmuccauhoiid = value; }
		}

        #region Comparison
        public static List<PhuonganEntity> Sort(List<PhuonganEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(PhuonganEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<PhuonganEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<PhuonganEntity> COMPARISON_PK_iPhuonganID
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.PK_iPhuonganID.CompareTo(other.PK_iPhuonganID);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_sNoidung
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.sNoidung.CompareTo(other.sNoidung);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_bDung
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.bDung.CompareTo(other.bDung);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_dNgaytao
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.dNgaytao.CompareTo(other.dNgaytao);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_dNgaycapnhat
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.dNgaycapnhat.CompareTo(other.dNgaycapnhat);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_FK_iNguoitao
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.FK_iNguoitao.CompareTo(other.FK_iNguoitao);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_FK_iNguoicapnhat
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.FK_iNguoicapnhat.CompareTo(other.FK_iNguoicapnhat);
				};
			}
		}
		public static Comparison<PhuonganEntity> COMPARISON_FK_iDanhmuccauhoiID
		{
			get
			{
				return delegate(PhuonganEntity entity,PhuonganEntity other)
				{
					return entity.FK_iDanhmuccauhoiID.CompareTo(other.FK_iDanhmuccauhoiID);
				};
			}
		}
        #endregion
    }
}
